package com.itheima.reggie.common;

import com.itheima.reggie.domain.User;

//向ThreadLocal保存、删除、查询Employee信息
public class UserHolder {
    //创建ThreadLocal对象
    private  static ThreadLocal<User> threadLocal = new ThreadLocal<>();
    //保存
    public static void set(User user) {
        threadLocal.set(user);
    }

    //获取
    public static User get() {
        return threadLocal.get();
    }

    //删除
    public static void remove() {
        threadLocal.remove();
    }
}
